package com.becca.cake.core.common;

public class PagingBean {
    public static final String  PAGING_BEAN       = "_paging_bean";
    public static final Integer DEFAULT_PAGE_SIZE = Integer.valueOf(25);
    public static final int     SHOW_PAGES        = 6;
    public Integer              start;
    private Integer             pageSize;
    private Integer             totalItems;                             // 总记录数
    private String              sort;
    private String              dir;

    public PagingBean(int start, int limit) {
        this.pageSize = Integer.valueOf(limit);
        this.start = Integer.valueOf(start);
    }

    public PagingBean(int start, int limit, String sort, String dir) {
        this.pageSize = Integer.valueOf(limit);
        this.start = Integer.valueOf(start);
        this.sort = sort;
        this.dir = dir;
    }

    public Integer getPageSize() {
        return this.pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = Integer.valueOf(pageSize);
    }

    public int getTotalItems() {
        return this.totalItems.intValue();
    }

    public Integer getStart() {
        return this.start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public void setTotalItems(Integer totalItems) {
        this.totalItems = totalItems;
    }

    public void setTotalItems(int totalItems) {
        this.totalItems = Integer.valueOf(totalItems);
    }

    public int getFirstResult() {
        return this.start.intValue();
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getDir() {
        return dir;
    }

    public void setDir(String dir) {
        this.dir = dir;
    }

}
